package com.electronic.api;

import lombok.AllArgsConstructor;
import lombok.Getter;

import javax.servlet.http.HttpServletResponse;

/**
 * 业务代码枚举 -- 业务相关
 * <p>
 * 定义常见的业务操作结果码和对应的消息，用于统一响应结果。
 *
 * @author weijunjie
 * ===============================
 * Date：2024年7月23号
 * Time：上午12:45
 * ================================
 */
@Getter
@AllArgsConstructor
public enum BusinessResultCode implements IResultCode {

    /*************************************** 公共报错 ******************************************************/
    FAILURE_003_01_B_001(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_001", "请求路径未发现"),
    FAILURE_003_01_B_002(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_002", "auth 鉴权失败"),
    FAILURE_003_01_B_003(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_003", "signature 鉴权"),
    FAILURE_003_01_D_004(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_004", "CA共享组件信息错误"),
    FAILURE_003_01_D_005(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_005", "全局配置信息错误"),
    /*************************************** 电子签章 ******************************************************/
    FAILURE_003_01_B_006(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_006", "生成签章二维码失败"),
    FAILURE_003_01_D_007(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_007", "未获取到电子签章二维码扫码状态"),
    FAILURE_003_01_P_008(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_008", "tid不能为空"),
    FAILURE_003_01_P_009(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_009", "tid不能为空"),
    FAILURE_003_01_D_010(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_010", "未获取到签章用户信息"),
    FAILURE_003_01_P_011(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_011", "tid不能为空"),
    FAILURE_003_01_D_012(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_012", "未获取到来源APP编码"),
    FAILURE_003_01_P_013(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_013", "tid不能为空"),
    FAILURE_003_01_D_014(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_014", "未获取到来源APP编码"),
    FAILURE_003_01_D_015(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_015", "未获取到待签名原文签名值"),
    FAILURE_003_01_P_016(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_016", "未获取到签章控件列表"),
    FAILURE_003_01_P_017(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_017", "参数为空"),
    FAILURE_003_01_B_018(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_018", "生成撤章二维码失败"),
    FAILURE_003_01_P_019(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_019", "参数为空"),
    FAILURE_003_01_D_020(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_020", "未获取到撤章码扫码状态"),
    FAILURE_003_01_P_021(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_021", "参数为空"),
    FAILURE_003_01_D_022(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_022", "未获取到签名值"),
    FAILURE_003_01_B_023(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_023", "生成消息解密码--未从请求头中获取到交易系统编码"),
    FAILURE_003_01_B_024(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_024", "生成消息解密二维码失败"),
    FAILURE_003_01_B_025(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_025", "参数为空"),
    FAILURE_003_01_D_026(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_026", "未获取到消息解密码扫码状态"),
    FAILURE_003_01_P_027(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_027", "参数为空"),
    FAILURE_003_01_D_028(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_028", "未获取到解密用户信息"),
    FAILURE_003_01_P_029(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_029", "参数为空"),
    FAILURE_003_01_D_030(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_030", "未获取到解密后的数据"),
    FAILURE_003_01_B_031(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_031", "生成消息加密二维码失败"),
    FAILURE_003_01_P_032(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_032", "参数为空"),
    FAILURE_003_01_D_033(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_033", "未获取到消息加密码扫码状态"),
    FAILURE_003_01_D_034(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_034", "未获取到用户加密证书信息"),
    FAILURE_003_01_P_035(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_035", "参数为空"),
    FAILURE_003_01_P_036(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_036", "参数为空"),
    FAILURE_003_01_B_037(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_037", "生成消息签名二维码失败"),
    FAILURE_003_01_D_038(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_038", "未获取到消息加密码扫码状态"),
    FAILURE_003_01_P_039(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_039", "参数为空"),
    FAILURE_003_01_D_040(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_040", "未获取到签名值信息"),
    FAILURE_003_01_P_041(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_041", "参数为空"),
    FAILURE_003_01_P_042(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_042", "参数为空"),
    FAILURE_003_01_B_043(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_043", "验签失败"),
    FAILURE_003_01_B_044(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_044", "登录--未从请求头中获取到交易系统编码"),
    FAILURE_003_01_B_045(HttpServletResponse.SC_BAD_REQUEST, "003_01_B_045", "生成登录二维码失败"),
    FAILURE_003_01_P_046(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_046", "参数为空"),
    FAILURE_003_01_D_047(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_047", "未获取到登录码扫码状态"),
    FAILURE_003_01_D_048(HttpServletResponse.SC_BAD_REQUEST, "003_01_D_048", "未获取到用户认证信息"),
    FAILURE_003_01_P_049(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_049", "参数为空"),
    FAILURE_003_01_P_050(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_050", "初始化回调地址集合为空"),
    FAILURE_003_01_P_051(HttpServletResponse.SC_BAD_REQUEST, "003_01_P_051", "CA机构证书链验证标识为空"),

    /*********************************************************App-电子签章模块*****************************************************************/
    FAILURE_003_02_B_010(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_010", "数据不存在-tid"),
    FAILURE_003_02_B_011(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_011", "签章二维码扫描状态更新失败：数据不存在-tid"),
    FAILURE_003_02_B_012(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_012", "数据已存在-tid"),
    FAILURE_003_02_B_013(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_013", "数据已存在-tid"),
    FAILURE_003_02_P_014(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_014", "未获取到来源APP编码"),
    FAILURE_003_02_P_015(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_015", "未获取到来源APP编码"),
    FAILURE_003_02_P_016(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_016", "未获取到来源APP编码"),
    FAILURE_003_02_N_017(HttpServletResponse.SC_BAD_REQUEST, "003_02_N_017", "上传待签名原文失败"),
    FAILURE_003_02_B_018(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_018", "数据已存在-tid"),
    FAILURE_003_02_P_019(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_019", "未获取到来源APP编码"),
    FAILURE_003_02_N_020(HttpServletResponse.SC_BAD_REQUEST, "003_02_N_020", "用户退出签章失败"),
    FAILURE_003_02_P_021(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_021", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_022(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_022", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_N_023(HttpServletResponse.SC_BAD_REQUEST, "003_02_N_023", "获取单位印章信息失败"),
    FAILURE_003_02_P_024(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_024", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_N_025(HttpServletResponse.SC_BAD_REQUEST, "003_02_N_025", "获取个人印章信息失败"),
    FAILURE_003_02_P_026(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_026", "参数异常（xxx 不可为空）"),
    /**************************************************App-消息解密****************************************************************/
    FAILURE_003_02_B_027(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_027", "数据不存在-tid"),
    FAILURE_003_02_B_028(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_028", "数据不存在-tid"),
    FAILURE_003_02_B_029(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_029", "未获取到来源APP编码"),
    FAILURE_003_02_N_030(HttpServletResponse.SC_BAD_REQUEST, "003_02_N_030", "上传加密密钥信封失败"),
    FAILURE_003_02_P_031(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_031", "证件号码不能为空"),
    FAILURE_003_02_P_032(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_032", "单位代码不能为空"),
    FAILURE_003_02_P_033(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_033", "解密用户类型不能为空"),
    FAILURE_003_02_B_034(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_034", "数据已存在-tid"),
    FAILURE_003_02_P_035(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_035", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_036(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_036", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_037(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_037", "参数异常（xxx 不可为空）"),

    /**************************************************App-消息加密****************************************************************/
    FAILURE_003_02_B_038(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_038", "该数据已存在-tid"),
    FAILURE_003_02_B_039(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_039", "该数据已存在-tid"),
    FAILURE_003_02_P_040(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_040", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_041(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_041", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_B_058(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_058", "消息加密二维码扫描状态更新失败：数据不存在-tid"),

    /**************************************************App-消息签名****************************************************************/

    FAILURE_003_02_B_042(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_042", "数据不存在-tid"),
    FAILURE_003_02_P_043(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_043", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_044(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_044", "参数异常（xxx 不可为空）"),
    /**************************************************App-推送扫码状态****************************************************************/

    FAILURE_003_02_B_045(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_045", "数据不存在-tid"),
    FAILURE_003_02_P_046(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_046", "未获取到来源APP编码"),
    FAILURE_003_02_B_047(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_047", "该数据已存在-tid"),
    FAILURE_003_02_P_048(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_048", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_049(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_049", "参数异常（xxx 不可为空）"),

    /**************************************************App-撤销电子签章****************************************************************/
    FAILURE_003_02_B_050(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_050", "数据未查到-tid:"),
    FAILURE_003_02_B_051(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_051", "撤章二维码扫描状态更新失败：数据不存在-tid"),
    FAILURE_003_02_P_052(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_052", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_053(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_053", "参数异常（xxx 不可为空）"),
    /**************************************************App-共享注册登录****************************************************************/
    FAILURE_003_02_B_054(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_054", "该数据已存在-tid"),
    FAILURE_003_02_B_055(HttpServletResponse.SC_BAD_REQUEST, "003_02_B_055", "该数据已存在-tid"),
    FAILURE_003_02_P_056(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_056", "参数异常（xxx 不可为空）"),
    FAILURE_003_02_P_057(HttpServletResponse.SC_BAD_REQUEST, "003_02_P_057", "登录二维码扫描状态更新失败：数据不存在-tid"),
    /************************************************** common ****************************************************************/

    FAILURE_003_00_P_001(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_001", "未查询到请求路径，请检查"),
    FAILURE_003_00_P_002(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_002", "参数解密失败"),
    FAILURE_003_00_P_003(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_003", "请求中中不包含AppCode，请完善后重新发起请求"),
    FAILURE_003_00_P_004(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_004", "未获取到该APP的公钥信息，请检查AppCode参数是否正确，或检查CA互认服务组件是否已开通该APP"),
    FAILURE_003_00_P_005(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_005", "签名验证失败"),
    FAILURE_003_00_P_006(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_006", "客户端认证失败，请检查请求头 [Authorization] 信息"),
    FAILURE_003_00_P_007(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_007", "请检查请求头[Authorization]的信息"),
    FAILURE_003_00_P_008(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_008", "客户端令牌解析失败"),
    FAILURE_003_00_P_009(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_009", "客户端令牌不合法"),
    FAILURE_003_00_P_011(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_011", "请使用LinkedHashMap初始化缓存集合"),
    FAILURE_003_00_P_012(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_012", "私钥不能为空"),
    FAILURE_003_00_P_013(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_013", "私钥尚未设置"),
    FAILURE_003_00_P_014(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_014", "应用标识不能为空（AppCode）"),
    FAILURE_003_00_P_015(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_015", "APP服务端公钥不能为空!"),
    FAILURE_003_00_P_016(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_016", "解析子证书，获取公钥失败!"),
    FAILURE_003_00_P_017(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_017", "appCode不能为空"),
    FAILURE_003_00_P_018(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_018", "app服务端地址不能为空"),
    FAILURE_003_00_P_019(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_019", "此App未在自助开通系统开通"),
    FAILURE_003_00_P_020(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_020", "未获取到二维码扫码状态创建时间！"),
    FAILURE_003_00_P_021(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_021", "解密状态错误！"),
    FAILURE_003_00_P_022(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_022", "三方数据响应失败！"),
    FAILURE_003_00_P_023(HttpServletResponse.SC_BAD_REQUEST, "003_00_P_023", "解密失败！请检查加密密钥是否正确"),


    ;

    /**
     * code编码
     */
    final int code;

    /**
     * 错误码
     */
    final String errorCode;

    /**
     * 中文信息描述
     */
    final String message;
}